<!DOCTYPE html>
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
  <meta name="description" content="刘清政">
  <meta name="keyword" content="hexo-theme">
  
    <link rel="shortcut icon" href="/css/images/logo.png">
  
  <title>
    
      Justin-刘清政的博客
    
  </title>
  <link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
  <link href="//cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.css" rel="stylesheet">
  <link href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/tomorrow.min.css" rel="stylesheet">
  
<link rel="stylesheet" href="/css/style.css">

  
    
<link rel="stylesheet" href="/css/plugins/gitment.css">

  
  <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/geopattern/1.2.3/js/geopattern.min.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.js"></script>
  
    
<script src="/js/qrious.js"></script>

  
  
    
<script src="/js/gitment.js"></script>

  
  

  
<meta name="generator" content="Hexo 4.2.0"></head>
<div class="wechat-share">
  <img src="/css/images/logo.png" />
</div>

  <body>
    <header class="header fixed-header">
  <div class="header-container">
    <a class="home-link" href="/">
      <div class="logo"></div>
      <span>Justin-刘清政的博客</span>
    </a>
    <ul class="right-list">
      
        <li class="list-item">
          
            <a href="/" class="item-link active">主页</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/tags/" class="item-link">标签</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/archives/" class="item-link">归档</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/about/" class="item-link">关于我</a>
          
        </li>
      
    </ul>
    <div class="menu">
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </div>
    <div class="menu-mask">
      <ul class="menu-list">
        
          <li class="menu-item">
            
              <a href="/" class="menu-link mobile-active">主页</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/tags/" class="menu-link">标签</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/archives/" class="menu-link">归档</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/about/" class="menu-link">关于我</a>
            
          </li>
        
      </ul>
    </div>
  </div>
</header>

    <main class="app-body">
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/python/Django%E6%A1%86%E6%9E%B6/14-Django%E9%AB%98%E7%BA%A7%E4%B9%8B-forms%E7%BB%84%E4%BB%B6/">python/Django框架/14-Django高级之-forms组件</a>
      </h2>
      <p class="article-date">2020年9月24日</p>
      
      <div class="article-summary">
        
          *1 校验字段功能 * 针对一个实例：注册用户讲解。
 模型：models.py
1234class UserInfo(models.Model):    name=models.CharField(max_length=32)    pwd=models.CharField(max_len ...
        
      </div>
      <a class="more" href="/python/Django%E6%A1%86%E6%9E%B6/14-Django%E9%AB%98%E7%BA%A7%E4%B9%8B-forms%E7%BB%84%E4%BB%B6/">详情...</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/python/Django%E6%A1%86%E6%9E%B6/15-Django%E9%AB%98%E7%BA%A7%E4%B9%8B-cookie%E4%B8%8Esession/">python/Django框架/15-Django高级之-cookie与session</a>
      </h2>
      <p class="article-date">2020年9月24日</p>
      
      <div class="article-summary">
        
          1 会话跟踪技术什么是会话跟踪我们需要先了解一下什么是会话！可以把会话理解为客户端与服务器之间的一次会晤，在一次会晤中可能会包含多次请求和响应。例如你给10086打个电话，你就是客户端，而10086服务人员就是服务器了。从双方接通电话那一刻起，会话就开始了，到某一方挂断电话表示会话结束。在通 ...
        
      </div>
      <a class="more" href="/python/Django%E6%A1%86%E6%9E%B6/15-Django%E9%AB%98%E7%BA%A7%E4%B9%8B-cookie%E4%B8%8Esession/">详情...</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/python/Django%E6%A1%86%E6%9E%B6/8-%E6%A8%A1%E5%9E%8B%E5%B1%82-%E5%8D%95%E8%A1%A8%E6%93%8D%E4%BD%9C/">python/Django框架/8-模型层-单表操作</a>
      </h2>
      <p class="article-date">2020年9月24日</p>
      
      <div class="article-summary">
        
          一 ORM简介查询数据层次图解：如果操作mysql，ORM是在pymysq之上又进行了一层封装





MVC或者MTV框架中包括一个重要的部分，就是ORM，它实现了数据模型与数据库的解耦，即数据模型的设计不需要依赖于特定的数据库，通过简单的配置就可以轻松更换数据库，这极大的减轻了开发人员 ...
        
      </div>
      <a class="more" href="/python/Django%E6%A1%86%E6%9E%B6/8-%E6%A8%A1%E5%9E%8B%E5%B1%82-%E5%8D%95%E8%A1%A8%E6%93%8D%E4%BD%9C/">详情...</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/python/Django%E6%A1%86%E6%9E%B6/5-%E8%B7%AF%E7%94%B1%E6%8E%A7%E5%88%B6/">python/Django框架/5-路由控制</a>
      </h2>
      <p class="article-date">2020年9月24日</p>
      
      <div class="article-summary">
        
          一 Django中路由的作用URL配置(URLconf)就像Django 所支撑网站的目录。它的本质是URL与要为该URL调用的视图函数之间的映射表；你就是以这种方式告诉Django，对于客户端发来的某个URL调用哪一段逻辑代码对应执行
典型的例子：
123456from django.ur ...
        
      </div>
      <a class="more" href="/python/Django%E6%A1%86%E6%9E%B6/5-%E8%B7%AF%E7%94%B1%E6%8E%A7%E5%88%B6/">详情...</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/python/Django%E6%A1%86%E6%9E%B6/16-Django%E9%AB%98%E7%BA%A7%E4%B9%8B-%E4%B8%AD%E9%97%B4%E4%BB%B6/">python/Django框架/16-Django高级之-中间件</a>
      </h2>
      <p class="article-date">2020年9月24日</p>
      
      <div class="article-summary">
        
          一 什么是中间件中间件顾名思义，是介于request与response处理之间的一道处理过程，相对比较轻量级，并且在全局上改变django的输入与输出。因为改变的是全局，所以需要谨慎实用，用不好会影响到性能
Django中间件的定义：
12Middleware is a framework  ...
        
      </div>
      <a class="more" href="/python/Django%E6%A1%86%E6%9E%B6/16-Django%E9%AB%98%E7%BA%A7%E4%B9%8B-%E4%B8%AD%E9%97%B4%E4%BB%B6/">详情...</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/go/4-Go%E8%AF%AD%E8%A8%80%E6%A1%86%E6%9E%B6/4-1-gin%E6%A1%86%E6%9E%B6/8-GORM%E5%A2%9E%E5%88%A0%E6%9F%A5%E6%94%B9/">go/4-Go语言框架/4-1-gin框架/8-GORM增删查改</a>
      </h2>
      <p class="article-date">2020年9月16日</p>
      
      <div class="article-summary">
        
          CRUD通常指数据库的增删改查操作，本文详细介绍了如何使用GORM实现创建、查询、更新和删除操作。
CRUDCRUD通常指数据库的增删改查操作，本文详细介绍了如何使用GORM实现创建、查询、更新和删除操作。
本文中的db变量为*gorm.DB对象，例如：
1234567891011impor ...
        
      </div>
      <a class="more" href="/go/4-Go%E8%AF%AD%E8%A8%80%E6%A1%86%E6%9E%B6/4-1-gin%E6%A1%86%E6%9E%B6/8-GORM%E5%A2%9E%E5%88%A0%E6%9F%A5%E6%94%B9/">详情...</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/go/4-Go%E8%AF%AD%E8%A8%80%E6%A1%86%E6%9E%B6/4-1-gin%E6%A1%86%E6%9E%B6/7-GORM%E4%BD%BF%E7%94%A8/">go/4-Go语言框架/4-1-gin框架/7-GORM使用</a>
      </h2>
      <p class="article-date">2020年9月16日</p>
      
      <div class="article-summary">
        
          gorm是一个使用Go语言编写的ORM框架。它文档齐全，对开发者友好，支持主流数据库。
gorm介绍Github GORM
中文官方网站内含十分齐全的中文文档，有了它你甚至不需要再继续向下阅读本文。
安装1go get -u github.com/jinzhu/gorm

连接数据库连接不同 ...
        
      </div>
      <a class="more" href="/go/4-Go%E8%AF%AD%E8%A8%80%E6%A1%86%E6%9E%B6/4-1-gin%E6%A1%86%E6%9E%B6/7-GORM%E4%BD%BF%E7%94%A8/">详情...</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/go/4-Go%E8%AF%AD%E8%A8%80%E6%A1%86%E6%9E%B6/4-1-gin%E6%A1%86%E6%9E%B6/6-%E4%BC%9A%E8%AF%9D%E6%8E%A7%E5%88%B6/">go/4-Go语言框架/4-1-gin框架/6-会话控制</a>
      </h2>
      <p class="article-date">2020年9月16日</p>
      
      <div class="article-summary">
        
          一 Cookie的使用测试服务端发送cookie给客户端，客户端请求时携带cookie
123456789101112131415161718192021222324252627282930313233package mainimport (   "fmt"   "github.com/gi ...
        
      </div>
      <a class="more" href="/go/4-Go%E8%AF%AD%E8%A8%80%E6%A1%86%E6%9E%B6/4-1-gin%E6%A1%86%E6%9E%B6/6-%E4%BC%9A%E8%AF%9D%E6%8E%A7%E5%88%B6/">详情...</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/go/4-Go%E8%AF%AD%E8%A8%80%E6%A1%86%E6%9E%B6/4-1-gin%E6%A1%86%E6%9E%B6/5-gin%E4%B8%AD%E9%97%B4%E4%BB%B6/">go/4-Go语言框架/4-1-gin框架/5-gin中间件</a>
      </h2>
      <p class="article-date">2020年9月16日</p>
      
      <div class="article-summary">
        
          一 全局中间件所有请求都经过此中间件
1234567891011121314151617181920212223242526272829303132333435363738394041package mainimport (   "fmt"   "time"   "github.com/gi ...
        
      </div>
      <a class="more" href="/go/4-Go%E8%AF%AD%E8%A8%80%E6%A1%86%E6%9E%B6/4-1-gin%E6%A1%86%E6%9E%B6/5-gin%E4%B8%AD%E9%97%B4%E4%BB%B6/">详情...</a>
    </article>
  
    <article class="article-card">
      <h2 class="article-head">
        <a href="/go/4-Go%E8%AF%AD%E8%A8%80%E6%A1%86%E6%9E%B6/4-1-gin%E6%A1%86%E6%9E%B6/4-gin%E6%B8%B2%E6%9F%93/">go/4-Go语言框架/4-1-gin框架/4-gin渲染</a>
      </h2>
      <p class="article-date">2020年9月16日</p>
      
      <div class="article-summary">
        
          一 各种数据格式的响应123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051package mainimport (   "github.com/gin-gon ...
        
      </div>
      <a class="more" href="/go/4-Go%E8%AF%AD%E8%A8%80%E6%A1%86%E6%9E%B6/4-1-gin%E6%A1%86%E6%9E%B6/4-gin%E6%B8%B2%E6%9F%93/">详情...</a>
    </article>
  

  
    <div class="guide-pager">
  
    <a href="/page/15/"><span class="page-arrow">← </span>Prev</a>
  
  
    <a href="/page/17/">Next<span class="page-arrow"> →</span></a>
  
</div>
  
</main>


    <div class="scroll-top">
  <span class="arrow-icon"></span>
</div>
    <footer class="app-footer">
<!-- 不蒜子统计 -->
<span id="busuanzi_container_site_pv">
     本站总访问量<span id="busuanzi_value_site_pv"></span>次
</span>
<span class="post-meta-divider">|</span>
<span id="busuanzi_container_site_uv" style='display:none'>
     本站访客数<span id="busuanzi_value_site_uv"></span>人
</span>
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>



  <p class="copyright">
    &copy; 2021 | Proudly powered by <a href="https://www.cnblogs.com/xiaoyuanqujing" target="_blank">小猿取经</a>
    <br>
    Theme by <a href="https://www.cnblogs.com/xiaoyuanqujing" target="_blank" rel="noopener">小猿取经</a>
  </p>
</footer>

<script>
  function async(u, c) {
    var d = document, t = 'script',
      o = d.createElement(t),
      s = d.getElementsByTagName(t)[0];
    o.src = u;
    if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
    s.parentNode.insertBefore(o, s);
  }
</script>
<script>
  async("//cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.6/fastclick.min.js", function(){
    FastClick.attach(document.body);
  })
</script>

<script>
  var hasLine = 'true';
  async("//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js", function(){
    $('figure pre').each(function(i, block) {
      var figure = $(this).parents('figure');
      if (hasLine === 'false') {
        figure.find('.gutter').hide();
      }
      var lang = figure.attr('class').split(' ')[1] || 'code';
      var codeHtml = $(this).html();
      var codeTag = document.createElement('code');
      codeTag.className = lang;
      codeTag.innerHTML = codeHtml;
      $(this).attr('class', '').empty().html(codeTag);
      figure.attr('data-lang', lang.toUpperCase());
      hljs.highlightBlock(block);
    });
  })
</script>





<!-- Baidu Tongji -->

<script>
    var _baId = 'c5fd96eee1193585be191f318c3fa725';
    // Originial
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?" + _baId;
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
</script>


<script src="/js/script.js"></script>


<script src="/js/search.js"></script>


<script src="/js/load.js"></script>



  <span class="local-search local-search-google local-search-plugin" style="right: 50px;top: 70px;;position:absolute;z-index:2;">
      <input type="search" placeholder="站内搜索" id="local-search-input" class="local-search-input-cls" style="">
      <div id="local-search-result" class="local-search-result-cls"></div>
  </span>


  </body>
</html>